package com.ssy.mall.exception;

/**
 * 描述 异常枚举
 */
public enum SsyMallExceptionEnum {
    NEED_USER_NAME(10001,"用户名不能为空"),
    NEED_PASSWORD(10002,"密码不能为空"),
    PASSWORD_TOO_SHORT(10003,"密码不能少于8位"),
    NAME_EXISTED(10004,"不允许重名，注册失败"),
    INSERT_FAILED(10005,"插入失败，请重试"),
    WRONG_PASSWORD(10006,"账号或密码错误"),
    NEED_LOGIN(10007,"需要登录"),
    UPDATE_FAILED(10008,"更新失败，请重试"),
    NEED_ADMIN(10009,"无管理员权限"),
    NAME_NOT_NULL(10010,"名字不能为空"),
    CATEGORY_EXISTED(10011,"不允许重名"),
    CREATE_FAILED(10012,"新建失败"),
    REQUEST_PARAM_ERROR(10013,"参数错误"),
    DELETE_FAILED(10014,"找不到id，删除失败"),
    MKDIR_FAILED(10015,"文件夹创建失败"),
    UPLOAD_FAILED(10016,"图片上传失败"),
    NOT_SALE(10017,"商品状态不可售"),
    NOT_ENOUGH(10018,"商品库存不足"),
    CART_EMPTY(10019,"购物车已勾选的商品为空！"),
    NO_ENUM(10020,"未找到对应的枚举类"),
    NO_ORDER(10021,"该订单不存在"),
    NO_YOU_ORDER(10022,"这不是你的订单"),
    WRONG_ORDER_STATUS(10023,"订单状态不符"),
    SYSTEM_ERROR(20000,"系统异常")
    ;
    /**
     *  异常码
     */
    Integer code;
    String msg;

    SsyMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
